package com.example.txttoyy

import android.net.Uri
import android.os.Environment
import androidx.core.content.FileProvider
import java.io.File

class MyFileProvider : FileProvider() {

    override fun getType(uri: Uri): String? {
        return super.getType(uri)
    }

    fun getFile(uri: Uri): File {
        // 获取文件的路径
        val filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path + "/myapp.war"

        // 返回文件
        return File(filePath)
    }
}
